home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
5
/
CHASSIS_
/
PLACEALE.C
< prev
next >
Wrap
Text File
|
1992-05-14
|
1KB
|
48 lines
/************************************************************************************/
/* PlaceAlert */
/* */
/* Loads the alert template into memory, and resets the value of the bounds rect */
/* to position it on the screen. */
/* */
/************************************************************************************/
#include "MyHeaders.h"
int PlaceAlert(alrtNo)
{
int PARetCode = 0; /* set return code */
Rect saveRect; /* work area */
int rectHeight;
int rectWidth;
int newH, newV;
myATmplH = (AlertTemplate **) GetResource ('ALRT', alrtNo);
if (ResError() != noErr)
PARetCode = 1;
else
{
HNoPurge(myATmplH); /* make not purgeable */
saveRect = (**myATmplH).boundsRect; /* save the current value */
rectHeight = saveRect.bottom - saveRect.top;
rectWidth = saveRect.right - saveRect.left;
newH = (screenBits.bounds.right - rectWidth) * .50; /* new left */
if (newH < 9)
newH = 9; /* not off screen */
newV = ((screenBits.bounds.bottom - 29 - rectHeight) * (.20)) + 29; /* top */
if (newV < 29)
newV = 29; /* not into menu bar */
SetRect (&(**myATmplH).boundsRect, newH, newV,
(newH + rectWidth), (newV + rectHeight));
HPurge (myATmplH); /* make purgeable again */
CursorSelect (NIL, NIL, NIL);
}
return PARetCode;
}